<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var fun1 = function(){
				var btn = document.querySelector("button")//默认只取第一个
				btn.addEventListener("click",fun2,false)//创建监听
			}
			function fun2(){
				alert("按钮被点击")//javascript简易提示
			}
		</script>
	</head>
	<body>
		<button> 普通按钮</button>
		<button onclick="fun1()">添加</button>
		<button>移除</button>
		<script type="text/javascript">
			var btn3 = document.querySelectorAll("button")[2]
			btn3.onclick = function(){
				var btn = document.querySelector("button")
				btn.removeEventListener("click",fun2,false)
			}
			
		</script>
	</body>
</html>
